package com.fowo.api.datainterface.util.k3cloud.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.util.List;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
@FieldNameConstants
public class K3CloudResult {


    @JsonProperty("Result")
    private ResultDTO result;

    @Data
    @NoArgsConstructor
    @EqualsAndHashCode(callSuper=false)
    @FieldNameConstants
    public static class ResultDTO {
        @JsonProperty("ResponseStatus")
        private ResponseStatusDTO responseStatus;
        @JsonProperty("Id")
        private String id;
        @JsonProperty("Number")
        private String number;
        @JsonProperty("NeedReturnData")
        private List<NeedReturnDataDTO> needReturnData;

        @Data
        @NoArgsConstructor
        @EqualsAndHashCode(callSuper=false)
        @FieldNameConstants
        public static class ResponseStatusDTO {
            @JsonProperty("ErrorCode")
            private String errorCode;
            @JsonProperty("IsSuccess")
            private String isSuccess;
            @JsonProperty("Errors")
            private List<ErrorsDTO> errors;
            @JsonProperty("SuccessEntitys")
            private List<SuccessEntitysDTO> successEntitys;
            @JsonProperty("SuccessMessages")
            private List<SuccessMessagesDTO> successMessages;

            @Data
            @NoArgsConstructor
            @EqualsAndHashCode(callSuper=false)
            @FieldNameConstants
            public static class ErrorsDTO {
                @JsonProperty("FieldName")
                private String fieldName;
                @JsonProperty("Message")
                private String message;
                @JsonProperty("DIndex")
                private Integer dIndex;
            }

            @Data
            @NoArgsConstructor
            @EqualsAndHashCode(callSuper=false)
            @FieldNameConstants
            public static class SuccessEntitysDTO {
                @JsonProperty("Id")
                private String id;
                @JsonProperty("Number")
                private String number;
                @JsonProperty("DIndex")
                private Integer dIndex;
            }

            @Data
            @NoArgsConstructor
            @EqualsAndHashCode(callSuper=false)
            @FieldNameConstants
            public static class SuccessMessagesDTO {
            }
        }

        @Data
        @NoArgsConstructor
        @EqualsAndHashCode(callSuper=false)
        @FieldNameConstants
        public static class NeedReturnDataDTO {
        }
    }
}
